<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>老师信息表单</title>
    <!-- 引入element-ui样式 -->
    <link rel="stylesheet" href="../../../plugins/element-ui/index.css">
    <!--    上传图片样式-->
    <style>
        .avatar-uploader .el-upload {
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .avatar-uploader .el-upload:hover {
            border-color: #409EFF;
        }
        .avatar-uploader-icon {
            font-size: 28px;
            color: #8c939d;
            width: 178px;
            height: 178px;
            line-height: 178px;
            text-align: center;
        }
        .avatar {
            width: 178px;
            height: 178px;
            display: block;
        }
    </style>
</head>
<body>

<div id="app">

    <el-container style="height: 800px; border: 1px solid #eee">
        <el-container>
            <div style="width: 100%;position: relative">


                <el-table   size="medium" current-row-key="id"  :data="dataList" stripe highlight-current-row>
                    <el-table-column type="index" align="center" label="序号"></el-table-column>
                    <el-table-column prop="jobNumber" label="工号" align="center"></el-table-column>
                    <el-table-column prop="major" label="专业" align="center"></el-table-column>
                    <el-table-column prop="type" label="类型" align="center"></el-table-column>
                    <el-table-column prop="salary" label="薪水" align="center"></el-table-column>
                    <el-table-column prop="bonus" label="奖金" align="center"></el-table-column>
                    <el-table-column prop="time" label="时间" align="center"></el-table-column>
                    <el-table-column prop="remark" label="备注" align="center"></el-table-column>


                </el-table>

                <!--分页组件-->
                <el-pagination
                        class="pagination"
                        @current-change="handleCurrentChange"
                        :current-page="pagination.currentPage"
                        :page-size="pagination.pageSize"
                        layout="total, prev, pager, next, jumper"
                        :total="pagination.total">
                </el-pagination>

            </div>
        </el-container>
    </el-container>

</div>


<script src="../../../plugins/vue/vue.js"></script>

<!-- 引入element-ui组件库 -->
<script src="../../../plugins/element-ui/index.js"></script>

<!-- 引入axios -->
<script src="../../../plugins/axios/axios.min.js"></script>

<script>
    new Vue({
        el:'#app',    //element
        data:{

            adminInfo:"",
            //显示的数据
            dataList:[],

            //管理员搜索内容1
            Query:{
                jobNumber:""
            },
            //element-ui分页插件

            pagination: {
                //分页相关模型数据 1
                currentPage: 1,//当前页码1
                pageSize:5,//每页显示的记录数1
                total:0,//总记录数1
            },

            imageUrl:'',
        },

        created() {
            const adminInfo = window.localStorage.getItem('admin')
            console.log("adminInfo1:::"+adminInfo)
            if (adminInfo) {
                this.adminInfo = JSON.parse(adminInfo)
            }
            console.log("adminInfo2:::"+adminInfo)
            this.getAll();
        },

        methods:{

            getAll(){
                axios.get("/salarys/getPageSalaryByJobNumber/"+this.pagination.currentPage+"/"+this.pagination.pageSize+"/"+this.adminInfo.data.jobNumber+"?code=管理员").then((res)=>{
                    console.log("res:")
                    console.log(res)

                    this.dataList=res.data.data.records
                    this.pagination.total=res.data.data.total

                })
            },

            //切换页码
            handleCurrentChange(currentPage) {
                console.log("切换页码:")
                this.pagination.currentPage=currentPage;
                console.log(currentPage)
                this.getAll();
            },

            getImage (image) {
                this.imageUrl1= `/files/downloadFile?name=${image}`
            },
        }
    })

</script>
</body>
</html>